package fr.inserm.u915.tabixserver;

public class UCSCNameNormalizer implements ChromNameNormalizer
	{
	@Override
	public String normalize(String s)
		{
		if(s.equals("23") || s.equalsIgnoreCase("X")|| s.equalsIgnoreCase("chrX"))
			{
			return "chrX";
			}
		else if(s.equals("24") ||
				s.equalsIgnoreCase("Y")||
				s.equalsIgnoreCase("chrX"))
			{
			return "chrY";
			}
		else if(	s.equals("25") ||
			s.equalsIgnoreCase("M") ||
			s.equalsIgnoreCase("MT") ||
			s.equalsIgnoreCase("chrM")
			)
			{
			return "chrM";
			}
		while(s.startsWith("0")) s=s.substring(1);
		if(s.equalsIgnoreCase("MT")) s="M";
		if(!s.startsWith("chr")) s="chr"+s;
		return s;
		}
	}
